home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 19.zip / BS1 part 19 / Lattice C disk 4.adf / Compiler_Headers / intuition / intuitionbase.h < prev    next >
C/C++ Source or Header  |  1988-10-25  |  12KB  |  348 lines

  1. #ifndef INTUITION_INTUITIONBASE_H
  2. #define INTUITION_INTUITIONBASE_H
  3. /*
  4. **    $Filename: intuition/intuitionbase.h $
  5. **    $Release: 1.3 $
  6. **
  7. **    the IntuitionBase structure and supporting structures 
  8. **
  9. **    (C) Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #ifndef EXEC_LIBRARIES_H
  18. #include <exec/libraries.h>
  19. #endif
  20.  
  21. #ifndef INTUITION_INTUITION_H
  22. #include <intuition/intuition.h>
  23. #endif
  24.  
  25. #ifndef EXEC_INTERRUPTS_H
  26. #include <exec/interrupts.h>
  27. #endif
  28.  
  29. #ifdef INTUITIONPRIVATE
  30. /* these types and constants are used in the forbidden part of IntuitionBase.
  31.  * see below for an explanation that these are NOT supported for your use.
  32.  * They will certainly change in subsequent releases, and are provided
  33.  * for education, debugging, and information.
  34.  */
  35.  
  36. /* these are the display modes for which we have corresponding parameter
  37.  *  settings in the config arrays
  38.  */
  39. #define DMODECOUNT    0x0002    /* how many modes there are */
  40. #define HIRESPICK    0x0000
  41. #define LOWRESPICK    0x0001
  42.  
  43. #define EVENTMAX 10        /* size of event array */
  44.  
  45. /* these are the system Gadget defines */
  46. #define RESCOUNT    2
  47. #define HIRESGADGET    0
  48. #define LOWRESGADGET    1
  49.  
  50. #define GADGETCOUNT    8
  51. #define UPFRONTGADGET    0
  52. #define DOWNBACKGADGET    1
  53. #define SIZEGADGET    2
  54. #define CLOSEGADGET    3
  55. #define DRAGGADGET    4
  56. #define SUPFRONTGADGET    5
  57. #define SDOWNBACKGADGET 6
  58. #define SDRAGGADGET    7
  59.  
  60. /* jimm: 1/10/86: Intuition Locking */
  61. /* Let me say it again: don't even think about using this information
  62.  * in a program.
  63.  */
  64. #define ISTATELOCK    0    /* Intuition() not re-entrant        */
  65. #define LAYERINFOLOCK    1    /* dummy lock used to check protocol    */
  66. #define GADGETSLOCK    2    /* gadget lists, refresh, flags        */
  67. #define LAYERROMLOCK    3    /* (dummy) for lock layerrom        */
  68. #define VIEWLOCK    4    /* access to ViewLord            */
  69. #define IBASELOCK    5    /* protexts IBase pointers and lists    */
  70. #define RPLOCK        6    /* use of IBase->RP            */
  71. #define NUMILOCKS    7
  72.  
  73. /* ======================================================================== */
  74. /* === Intuition Geometric Primitives ===================================== */
  75. /* ======================================================================== */
  76.  
  77. struct FatIntuiMessage {
  78.     struct IntuiMessage;
  79.     ULONG  PrevKeys;
  80.     };
  81.  
  82. struct IBox {
  83.     SHORT Left;
  84.     SHORT Top;
  85.     SHORT Width;
  86.     SHORT Height;
  87.     };
  88.  
  89. struct Point {
  90.     SHORT X;
  91.     SHORT Y;
  92.     };
  93.  
  94. struct PenPair {
  95.     UBYTE DetailPen;
  96.     UBYTE BlockPen;
  97.     };
  98.  
  99. /* ======================================================================== */
  100. /* === Gadget Environments ================================================ */
  101. /* ======================================================================== */
  102.  
  103. /* environment for a whole list of gadgets. note that information for both
  104.  * layers of a G00 window are included.
  105.  */
  106. struct GListEnv     {
  107.     struct Screen    *ge_Screen;
  108.     struct Window    *ge_Window;
  109.     struct Requester    *ge_Requester;
  110.     struct RastPort    *ge_RastPort;    /* rastport used to render gadget   */
  111.     struct Layer    *ge_Layer;    /* layer for gadget (border, if G00)*/
  112.     struct Layer    *ge_GZZLayer;    /* interior layer for G00 windows   */
  113.     struct PenPair     ge_Pens;    /* pens for rendering gadget        */
  114.     struct IBox         ge_Domain;
  115.             /* window, screen, requester, rel. to window/screen */
  116.     struct IBox         ge_GZZdims;    /* interior window area            */
  117.     };
  118.  
  119. /* information for a gadget in its environment. includes relatively
  120.  * correct size, container for propgadgets, correct layer for this gadget,
  121.  * and back pointers to the environment and gadget itself
  122.  */
  123. struct GadgetInfo  {
  124.     struct GListEnv    *gi_Environ;    /* environment for this gadget        */
  125.     struct Gadget    *gi_Gadget;    /* gadget this info is for        */
  126.     struct IBox        gi_Box;        /* actual dimensions of gadget        */
  127.     struct IBox        gi_Container;    /* inner container dimensions        */
  128.     struct Layer    *gi_Layer;    /* correct layer for this gadget    */
  129.     struct IBox        gi_NewKnob;    /* place to draw new slider knob    */
  130.     };
  131. #endif    /* PRIVATE VALUES */
  132.  
  133. /* ======================================================================== */
  134. /* === IntuitionBase ====================================================== */
  135. /* ======================================================================== */
  136. /*
  137.  * Be sure to protect yourself against someone modifying these data as
  138.  * you look at them.  This is done by calling:
  139.  *
  140.  * lock = LockIBase(0), which returns a ULONG.    When done call
  141.  * UnlockIBase(lock) where lock is what LockIBase() returned.
  142.  */
  143.  
  144. struct IntuitionBase
  145. /* IntuitionBase should never be directly modified by programs    */
  146. /* even a little bit, guys/gals; do you hear me?    */
  147. {
  148.     struct Library LibNode;
  149.  
  150.     struct View ViewLord;
  151.  
  152.     struct Window *ActiveWindow;
  153.     struct Screen *ActiveScreen;
  154.  
  155.     /* the FirstScreen variable points to the frontmost Screen.     Screens are
  156.      * then maintained in a front to back order using Screen.NextScreen
  157.      */
  158.     struct Screen *FirstScreen; /* for linked list of all screens */
  159.  
  160.     ULONG Flags;    /* see definitions below */
  161.     WORD MouseY, MouseX;    /* mouse position relative to View */
  162.  
  163.     ULONG Seconds;    /* timestamp of most current input event */
  164.     ULONG Micros;    /* timestamp of most current input event */
  165.  
  166. #ifdef INTUITIONPRIVATE
  167.  
  168.     /* The following is a snapshot of the "private" part of 
  169.      * Intuition's library data.  It is included for educational
  170.      * use and your debugging only.  It is absolutely guaranteed
  171.      * that this structure will change from release to release.
  172.      *
  173.      * So: don't count on any of the values you find here
  174.      *       don't even think about changing any of these fields
  175.      *         (that goes for the "supported" fields above, too).
  176.      *
  177.      * Some work has been done to find the include files
  178.      * that these fields depend on.
  179.      *
  180.      *            jimm: 9/10/86.
  181.      */
  182.  
  183.     WORD MinXMouse, MaxXMouse;    /* bounded X position for the mouse */
  184.     WORD MinYMouse, MaxYMouse;    /* bounded Y position for the mouse */
  185.  
  186.     ULONG StartSecs, StartMicros;    /* measure double clicks */
  187.  
  188.     /* --------------- base vectors ----------------------------------- */
  189.     /* DO MOVE THESE OFFSETS WITHOUT ADJUSTING EQUATES IN IWORK.ASM 
  190.      * this is automatically handled by standalone program offsets.c
  191.      */
  192.     APTR    SysBase;
  193.     struct GfxBase *GfxBase;
  194.     APTR    LayersBase;
  195.     APTR    ConsoleDevice;
  196.  
  197.     /* --------------- Sprite Pointer --------------------------------- */
  198.     USHORT *APointer;    /* the ActiveGroup pointer sprite definition    */
  199.     BYTE APtrHeight;    /* height of the pointer */
  200.     BYTE APtrWidth;    /* width in pixels of the pointer (<= 16!)    */
  201.     BYTE AXOffset, AYOffset; /* sprite offsets */
  202.  
  203.  
  204.     /* ---------------- Menu Rendering and Operation ------------------ */
  205.     USHORT MenuDrawn;    /* menu/item/sub number of current display */
  206.     USHORT MenuSelected;/* menu/item/sub number of selected (and highlights)*/
  207.     USHORT OptionList;            /* menu selection    */
  208.  
  209.     /* this is the work RastPort used for building item and subitem displays
  210.      *    you can never count on it being stable, other than that it is
  211.      *    mostly a copy of the active screen's RastPort.
  212.      */
  213.     struct RastPort MenuRPort;
  214.     struct TmpRas    MenuTmpRas;
  215.     struct ClipRect ItemCRect; /* for the item's screen display */
  216.     struct ClipRect SubCRect; /* for the subitem's screen display */
  217.     struct BitMap IBitMap; /* for the item's planes */
  218.     struct BitMap SBitMap; /* for the subitem's planes */
  219.             
  220.     /* ---------------- Input Device Interface ------------------------ */
  221.     struct IOStdReq InputRequest;
  222.     struct Interrupt InputInterrupt;
  223.  
  224.     /* for dynamically allocated input events */
  225.     struct Remember  *EventKey;
  226.     struct InputEvent *IEvents;
  227.  
  228.     /* for statically "allocated" input events */
  229. #define NUM_IEVENTS 4
  230.     SHORT  EventCount;
  231.     struct InputEvent IEBuffer[NUM_IEVENTS];
  232.  
  233.     /* ---------------- Active Gadget Information --------------------- */
  234.     struct Gadget *ActiveGadget;
  235.     struct PropInfo *ActivePInfo;
  236.     struct Image *ActiveImage;
  237.     struct GListEnv GadgetEnv;    /* environment of the active gadget    */
  238.     struct GadgetInfo GadgetInfo;/* specific information for active gadget*/
  239.     struct Point KnobOffset;    /* position in knob of mouse when selected*/
  240.  
  241.     /* ---------------- Verify Functions Support ---------------------- */
  242.     /* hold information about getOK wait(), used for breakVerify() */
  243.     struct Window *getOKWindow;
  244.     struct IntuiMessage *getOKMessage;
  245.  
  246.     /* ---------------- State Machine --------------------------------- */
  247.     USHORT setWExcept, GadgetReturn, StateReturn;
  248.  
  249.     /* ----------- Intuition's Rendering for Gadgets, Titles, ... ----- */
  250.     /* This will be allocated on init */
  251.     struct RastPort    *RP;
  252.     struct TmpRas    ITmpRas;
  253.     struct Region *OldClipRegion;    /* locks with RPort */
  254.     struct Point    OldScroll;        /* user's Scroll_X/Y*/
  255.  
  256.     /* ----------- Frame Rendering for Window Size/Drag --------------- */
  257.     struct IBox IFrame; /* window frame for sizing/dragging    */
  258.     SHORT hthick, vthick;    /* IFrame thickness        */
  259.     VOID   (*frameChange)();    /* function to change IFrame    */
  260.     VOID   (*sizeDrag)();    /* either ISizeWindow or IMoveWindow */
  261.     struct Point FirstPt;    /* point from which s/d started */
  262.     struct Point OldPt;        /* previous point for s/d    */
  263.  
  264.     /* ---------------- System Gadget Templates ------------------------ */
  265.     struct Gadget *SysGadgets[RESCOUNT][GADGETCOUNT];
  266.     struct Image *CheckImage[RESCOUNT], *AmigaIcon[RESCOUNT];
  267.  
  268.     /* ---------------- Window Drag Rendering ------------------------- */
  269. #ifdef OLDPATTERN
  270.     USHORT apattern[3], bpattern[4];
  271. #else
  272.     USHORT apattern[8], bpattern[4];
  273. #endif
  274.  
  275.     /* --- Preferences Section ---------------------------------------------- */
  276.     USHORT *IPointer;    /* the INTUITION pointer default sprite definition */
  277.     BYTE IPtrHeight;    /* height of the pointer */
  278.     BYTE IPtrWidth;    /* width in pixels of the pointer (<= 16!) */
  279.     BYTE IXOffset, IYOffset; /* sprite offsets */
  280.  
  281.     LONG DoubleSeconds, DoubleMicros; /* for testing double-click timeout */
  282.  
  283.     /* ---------------- Border Widths --------------------------------- */
  284.     BYTE WBorLeft[DMODECOUNT];
  285.     BYTE WBorTop[DMODECOUNT];
  286.     BYTE WBorRight[DMODECOUNT];
  287.     BYTE WBorBottom[DMODECOUNT];
  288.  
  289.     BYTE BarVBorder[DMODECOUNT];
  290.     BYTE BarHBorder[DMODECOUNT];
  291.     BYTE MenuVBorder[DMODECOUNT];
  292.     BYTE MenuHBorder[DMODECOUNT];
  293.  
  294.     USHORT color0;
  295.     USHORT color1;
  296.     USHORT color2;
  297.     USHORT color3;
  298.     USHORT color17;
  299.     USHORT color18;
  300.     USHORT color19;
  301.  
  302.     struct TextAttr SysFont;
  303.  
  304.     /* WARNING:     you can easily wipe out Intuition by modifying this pointer 
  305.      * or the Preference data pointed to by this!
  306.      */
  307.     struct Preferences *Preferences;
  308.  
  309.     /* ----------------- Deferred action queue ---------------------- */
  310.     struct DistantEcho *Echoes;
  311.  
  312.     WORD ViewInitX, ViewInitY;    /* View initial offsets at startup   */
  313.  
  314.     SHORT CursorDX, CursorDY;    /* for accelerating pointer movement */
  315.  
  316.     struct KeyMap *KeyMap;    /* for the active String Gadget */
  317.     
  318.     SHORT MouseYMinimum;    /* magic    */
  319.  
  320.     SHORT ErrorX, ErrorY;    /* for retaining mouse movement round-off */
  321.     
  322.     struct timerequest IOExcess;
  323.  
  324.     SHORT HoldMinYMouse;
  325.  
  326.     struct MsgPort *WBPort, *iqd_FNKUHDPort;
  327.     struct IntuiMessage WBMessage;
  328.     struct Screen *HitScreen;    /* set by hitUpfront() routine */
  329.  
  330.     /** jimm:dale: 11/25/85, thought we'd take a chance for glory **/
  331.     struct SimpleSprite *SimpleSprite;
  332.     struct SimpleSprite *AttachedSSprite;
  333.     BOOL    GotSprite1;
  334.  
  335.     /** jimm: 1/6/86: Intuition contention **/
  336.     struct List            SemaphoreList;    /* chain of the below */
  337.     struct SignalSemaphore    ISemaphore[NUMILOCKS];
  338.  
  339.     WORD    MaxDisplayHeight;    /* in interlaced mode: 400 or 512 */
  340.     WORD    MaxDisplayRow;        /* MaxDisplayHeight - 1          */
  341.     WORD    MaxDisplayWidth;    /* copy of GfxBase's NormalDisplayCol */
  342.  
  343.     ULONG    Reserved[7];    /* cause one never know, do one? */
  344. #endif    /* PRIVATE VALUES */
  345. };
  346.  
  347. #endif    /* INTUITION_INTUITIONBASE_H */
  348.